package org.blogwu.smart.s039;

/**
 * TODO 类描述
 *
 * @author xiaohu
 * @date 2021/11/15
 **/
public class ThreadTest {

    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                int i = 1 / 0;
            }
        });
        t1.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(Thread t, Throwable e) {
                System.out.println(e.getMessage());
            }
        });
        t1.start();

        t1.join();
        System.out.println("over");
    }
}
